# 普通方式实现员工增删改查
import requests


from common.get_token import grt_login_token

token = grt_login_token()
id = '1524644536645648384'
# 添加员工
resp = requests.post('http://ihrm-test.itheima.net/api/sys/user', headers={"Authorization": token},
                     json={"username": "二哈", "mobile": "17622544466", "workNumber": "76478126312"})
print('添加员工', resp.json())


# 修改员工
resp = requests.put('http://ihrm-test.itheima.net/api/sys/user/' + id, headers={"Authorization": token},
                    json={"username": "俏丽哇"})
print('修改员工', resp.json())

# 查询员工
resp = requests.get('http://ihrm-test.itheima.net/api/sys/user/' + id, headers={"Authorization": token})
print('查询员工', resp.json())

# 删除员工
resp = requests.delete('http://ihrm-test.itheima.net/api/sys/user/' + id, headers={"Authorization": token})
print('删除员工', resp.json())
